package com.cysd.ewmxns.adapter

import android.content.Context
import android.view.ViewGroup
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.cysd.ewmxns.bean.DetailsBean
import qrrspeeelild.rqrc0ode.andro0ild.R

class DetailsAdapter : BaseQuickAdapter<DetailsBean, QuickViewHolder>(){
    override fun onBindViewHolder(
        holder: QuickViewHolder,
        position: Int,
        item: DetailsBean?
    ) {
        holder.setText(R.id.tv_title,item?.title)
        holder.setText(R.id.tv_content,item?.content)
        if (item?.img != null){
            holder.setImageResource(R.id.iv_desc,item.img!!)
        }
    }

    override fun onCreateViewHolder(
        context: Context,
        parent: ViewGroup,
        viewType: Int
    ): QuickViewHolder {
        return QuickViewHolder(R.layout.item_detials, parent)
    }
}